'use strict';

const initCategory = require('./routes/category');
const initComment = require('./routes/comment');
const initQuesttionAnswer = require('./routes/questtionAnswer');
const initTheme = require('./routes/theme');
const initUser = require('./routes/user');
const initCity = require('./routes/city');
const initThemeLike = require('./routes/themeLike');
const initOrderVip = require('./routes/order/vip');
const initOrderLike = require('./routes/order/like');
const initVerify = require('./routes/verify');

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // 授权登陆
  router.post('/api/authorization', controller.token.authorization);
  // 小程序解密
  router.post('/api/decrypt', controller.token.decrypt);
  // 绑定手机号
  router.post('/api/user/binding', controller.token.bindPhone);
  // 编辑用户资料
  router.put('/api/user', controller.user.edit);
  // 用户资料
  router.get('/api/user', controller.user.show);
  //每天推荐
  router.get('/api/user/recommend', controller.user.recommend);
  //今日推荐列表
  router.get('/api/user/recommend/type/:type', controller.user.like);
  //邀请好友页面
  router.get('/api/user/invite', controller.user.invite)
  //获取用户信息
  router.post('/api/user/info', controller.user.userInfo);
  //支付成功后获取用户信息
  router.get('/api/user/order', controller.user.order);
  //用户获取匹配爱好
  router.get('/api/user/marray_like', controller.user.getMarrayLike);
  //更新用户匹配爱好
  router.put('/api/user/marray_like', controller.user.updateMarrayLike);

  router.get('/api/send', controller.token.send);

  //身份、学历验证
  initVerify(router, controller);

  
  //广场轮播图
  router.get('/api/banner/theme', controller.banner.index);

  //userSig
  router.get('/api/im/usersig', controller.im.getUserSig)

  // 初始化用户
  initUser(router, controller);
  initCity(router, controller);

  //vip订单
  initOrderVip(router, controller);

  //超喜欢订单
  initOrderLike(router, controller);

  // 话题
  initTheme(router, controller);

    // 话题
  initThemeLike(router, controller);

  // 话题分类
  initThemeLike(router, controller);

  // 评论
  initComment(router, controller);

  // 题目问答表
  initQuesttionAnswer(router, controller);

  initCategory(router, controller);

  

};
